package com.ebid.xjc;

import javax.xml.XMLConstants;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.Unmarshaller;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.SchemaFactory;
import java.io.File;

public class Test {

    public static void main(String[] args) {
        JAXBContext context;
        try {
            context = JAXBContext.newInstance(QualifyBulletinPhase.class);

            Unmarshaller shaller = context.createUnmarshaller();

            shaller.setSchema(SchemaFactory.newInstance(
                    XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(
                    new File("qualifyBulletinPhaseXMLSchema.xsd")));

            JAXBElement<QualifyBulletinPhase> root = shaller.unmarshal(new StreamSource(new File("QualifyBulletinPhase.xml")),QualifyBulletinPhase.class);
            QualifyBulletinPhase jElem = root.getValue();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
